d8e2882216186ce1c31bfb9ddd65a3fbf1f802a7,src/main/java/com/hantsylabs/restexample/springmvc/config/SecurityConfig.java,SecurityConfig,configure,#HttpSecurity#,41
Before Change
.antMatchers("/api/**")
.authenticated()
.and()
.authorizeRequests()
.anyRequest()
.permitAll()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.httpBasic()
.and()
.csrf()
.disable();
}
After Change
.antMatchers("/api/mgt/**")
.hasRole("ADMIN")
.and()
.authorizeRequests()
.antMatchers("/api/**")
.authenticated()
.and()
.authorizeRequests()
.anyRequest()
.permitAll()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.httpBasic()
.and()
.csrf()
.disable();
}